var mongoose = require('mongoose');



var sensorSchema = mongoose.Schema({
	title:{
		type: String,
		required: true
	},
	
	description:{
		type: String,
	},

	rate:{
		type: String,
	},

});

var Sensor = module.exports = mongoose.model('sensor',sensorSchema);


module.exports.addSensor = function (sensor,callback) {
	Sensor.create(sensor,callback);
}



module.exports.getSensors = function (callback,limit) {
	Sensor.find(callback).limit(limit);
}